import playNotificationSound from "../utils/playNoticicationSound";
export const webScoketMsg = async (storeData, msg) => {
    const isSound=storeData.stateConfig.isSound||1

	const isSelf = msg.some((item) => {
		return storeData.user.userId === item.sendUserId
	})

	if (!isSelf && isSound===1) {

		playNotificationSound('msg');
	}
	if(!isSelf&&isSound===2){

		uni.vibrateLong()
	}
	const newMessage = msg.map((item) => ({
		...item,
		isSended: true,
		isRead: false
	}))

	return newMessage

}